﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace AiFrame.InterfaceLib.Windows.Controls
{
    /// <summary>
    /// Delegate for the click procedure.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void OnDataNavBarClickProcedure(object sender, EventArgs e);

    public interface IDataNavigationBar
    {
        /// <summary>
        /// Registers a new button.
        /// </summary>
        /// <param name="name">Unique name of the button.</param>
        /// <param name="caption">Caption of the button.</param>
        /// <param name="normalImage">Image of the button.</param>
        /// <param name="hoveredImage">Hover image of the button.</param>
        /// <param name="proc">On-click procedure.</param>
        void AddButton(string name, string caption, Image normalImage, 
            Image hoveredImage, OnDataNavBarClickProcedure proc);

        /// <summary>
        /// Registers a new button.
        /// </summary>
        /// <param name="name">Unique name of the button.</param>
        /// <param name="caption">Caption of the button.</param>
        /// <param name="normalImage">Image of the button.</param>
        /// <param name="hoveredImage">Hover image of the button.</param>
        /// <param name="saveObject">Saves an arbitrary object which can be used in the onClick-eventhandler.</param>
        /// <param name="positionIndex">Sets the position index for the button.</param>
        void AddButton(string name, string caption, Image normalImage,
            Image hoveredImage, OnDataNavBarClickProcedure proc, object saveObject, int positionIndex);

        /// <summary>
        /// Sets the parent control of the navigation bar.
        /// </summary>
        /// <param name="parent">The parent control.</param>
        void SetParent(Control parent);

        /// <summary>
        /// Sets the docking style of the navigation bar.
        /// </summary>
        /// <param name="dockingStyle">The docking style.</param>
        void SetDockingStyle(DockStyle dockingStyle);

        /// <summary>
        /// Gets the container control which contains
        /// all registered buttons.
        /// </summary>
        /// <returns>The container control</returns>
        Control GetButtonContainer();

        /// <summary>
        /// Gets the width of the navigation bar.
        /// </summary>
        int Width { get; }

        /// <summary>
        /// Brings the navigation bar to foreground.        
        /// </summary>
        void BringWindowToFront();

        /// <summary>
        /// Removes all buttons.
        /// </summary>
        void RemoveAllButtons();
    }
}
